Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset read-only attributes during rename operation #4483

Closed
wants to merge 2 commits into from

Conversation

dsl101
Copy link

@dsl101 dsl101 commented Jun 29, 2023

OK, this is an edge case as discussed here. Running git on windows for a repo that is mounted on an APFS filesystem fails, as it's not possible to rename a 'locked' (read only) file on APFS. This workaround checks if the rename fails, and if FILE_ATTRIBUTE_READONLY is set, resets it before attempting the rename again. If that succeeds, FILE_ATTRIBUTE_READONLY is applied to the renamed file.

David Lomas added 2 commits June 29, 2023 12:23
@dsl101
Copy link
Author

dsl101 commented Jun 29, 2023

OK, sorry, didn't mean to include v1 in there (failing whitespace check). I will close this one and reopen a new one.

@dsl101 dsl101 closed this Jun 29, 2023
@dscho
Copy link
Member

dscho commented Jul 7, 2023

OK, sorry, didn't mean to include v1 in there (failing whitespace check). I will close this one and reopen a new one.

For the record, you can easily force-push and re-use the same PR. That's actually my preference, to keep things together that belong together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants